# HG changeset patch # User Mads Kiilerich # Date 1687785411 -7200 # Mon Jun 26 15:16:51 2023 +0200 # Node ID 922b708e00ab7feb246d682132010185d9ced11d # Parent ac1c2c42edb73b7f7ee2de0950de74616d4bf3fb tests: drop test-demandimport.py distutils test that failed with warnings The test would fail because warnings: /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils. warnings.warn( /usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") The test for distutils.msvc9compiler comes from 2205d00b6d2b. But since then, distutils is going away, and this test must change somehow. It is unclear exactly how setuptools depended on msvc9compiler, but setuptools also moved forward, and this exact test no longer seems relevant. It thus seems like a fair solution to remove the test while keeping the demandimport blacklist of distutils.msvc9compiler. diff --git a/tests/test-demandimport.py b/tests/test-demandimport.py --- a/tests/test-demandimport.py +++ b/tests/test-demandimport.py @@ -31,18 +31,6 @@ try: except ImportError: moduletype = types.ModuleType -if os.name != 'nt': - try: - import distutils.msvc9compiler - - print( - 'distutils.msvc9compiler needs to be an immediate ' - 'importerror on non-windows platforms' - ) - distutils.msvc9compiler - except ImportError: - pass - import re rsub = re.sub _______________________________________________ Mercurial-devel mailing list Mercurial-devel@lists.mercurial-scm.org https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel